<?php

/**
 * Tache form.
 *
 * @package    tfe
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class TacheForm extends BaseTacheForm
{
  public function configure()
  {
      unset($this['created_at'], $this['updated_at'], $this['deleted_at']);
  
      $dateWidget = new sfWidgetFormI18nDate(array(
        'format' => '%day%/%month%/%year%',
        'culture'=>'fr'
        ));
      $this->widgetSchema['date'] = new sfWidgetFormJqueryDate(array(
          'date_widget' => $dateWidget,
         'culture'=>'fr_FR'
        ));

      $this->widgetSchema['id_contact']->setOption('renderer_class', 'sfWidgetFormDoctrineJQueryAutocompleter');
      $this->widgetSchema['id_contact']->setOption('renderer_options', array(
          'model' => 'Contact',
          'url'   => '/contact/autocomplete',
      ));

      $this->widgetSchema['id_groupe']->setOption('renderer_class', 'sfWidgetFormDoctrineJQueryAutocompleter');
      $this->widgetSchema['id_groupe']->setOption('renderer_options', array(
          'model' => 'Groupe',
          'url'   => '/groupe/autocomplete',
      ));


      $this->widgetSchema['responsable']->setOption('renderer_class', 'sfWidgetFormDoctrineJQueryAutocompleter');
      $this->widgetSchema['responsable']->setOption('renderer_options', array(
          'model' => 'Staff',
          'url'   => '/staff/autocomplete',
      ));
  }
}
